<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<div class="sidebar">
	<!-- 搜索栏 -->
	<div class="block search_form">
    	<form method="get" id="searchform" action="http://localhost/wordpress/">
		<div class="form">
		<input name="s" type="text" id="s" onblur="if (this.value =='') this.value='Search Blog...'" onfocus="this.value=''" onclick="if (this.value=='Search Blog...') this.value=''" value="Search Blog..." class="inputbox" />
		<span>
		<input type="submit" name="button" id="button" value="" class="go" />
		</span>
		</div><%-- form --%>
		</form>      
    </div><%-- 搜索栏 --%>
		
	<div class="block rad">
		<div class="rad_c"></div>
		
		</div>
        <div class="block feed_form">
        	
        </div>
        <div class="block categories"><h3>文章分类</h3>
        	<ul>
        	<c:forEach items="${categoryList}" var="category">
        		<li><a href="ShowPostsByCategory?id=${category.id }">${category.name }</a></li>
        	</c:forEach>
            </ul>
        </div>
        <div class="block"><h3>最新文章</h3>
        	<ul>
	        	<c:forEach items="${newPostTitleList}" var="newPost">
	        		<li><a href="ShowSinglePost?id=${newPost.id }">${newPost.title }</a></li>
	        	</c:forEach>
            </ul>
        </div>
        
        <div class="block"><h3>最受欢迎文章</h3>
        	<ul>
        	<c:forEach items="${viewRankList}" var= "viewRankPost">
        		<li><a href="ShowSinglePost?id=${viewRankPost.id }">${viewRankPost.title }</a></li>
        	</c:forEach>
        	</ul>
        </div>
        
        <div class="block comment"><h3>最新评论</h3>
        	<ul>
        		<c:forEach items="${newCommentList}" var= "comment">
        			<li class="new">
        			${comment.author }评论道：<br /> <a href="ShowSinglePost?id=${comment.postId}">${comment.content }</a>
        			</li>
        		</c:forEach>
        	</ul>
        </div>
        
        <div class="block">   <!--<h3>文章归档</h3>-->
        	
        </div>
        <!-- tag cloud -->
      
		<div class="block" id="tag_cloud"><!--<h3>Tag Cloud</h3>-->
            
        </div>
		
      
        <div class="block links"><h3>友情链接</h3>
        	<ul>
        		<li><a href="http://javafans.info">Java爱好者</a></li>
        	</ul>
        </div>
	
        
        <div class="block"><h3>Meta</h3>
        	<ul>
         		<c:if test="${user == null}">
         			<li><a href="login.jsp">登录</a></li>
         		</c:if>
         		<c:if test="${user != null}">
         			<li><a href="AdminServlet?action=manage">站点管理</a></li>
         			<li><a href="AdminServlet?action=logout">登出</a></li>
         		</c:if>
            </ul>
        </div>
        
		<!-- #secondary .widget-area -->

	</div><!-- sidebar -->
   